<template>
    <div class="padding20">
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <span>用户信息</span>
                <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
            </div>
            <div v-for="o in 4" :key="o" class="text item">
                {{'列表内容 ' + o }}
            </div>
        </el-card>
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <span>角色信息</span>
                <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
            </div>
            <div v-for="o in 4" :key="o" class="text item">
                {{'列表内容 ' + o }}
            </div>
        </el-card>
        <el-button @click="$K.back('/system/user/list')" size="medium">返 回</el-button>
    </div>
</template>

<script lang="ts">
    import {Component} from 'vue-property-decorator'
    import {API} from "@/aconst/API";
    import BaseVue from "@/utils/BaseVue";
    import {errorMsg, successMsg} from "@/utils/message";
    import {ElForm} from "element-ui/types/form";
    import $http from "@/http";
    import {rule} from "@/utils/Rule";

    @Component({
        name: 'UserInfo',
        components: {},
    })
    export default class UserInfo extends BaseVue {
        mFormData: any = {};
        mRules = {
            name: [rule.notNullBlur()],
        };

        //初始化
        async mounted() {

        }

        //重新获取焦点
        activated() {
        }

        //失去焦点
        deactivated() {
        }

        //执行修改操作
        insert() {
            (this.$refs.mFormData as ElForm).validate((valid: boolean) => {
                if (valid) {
                    $http.post(API.adminAppUserUpdate, this.mFormData)
                        .then((res: any) => {
                            if (res.success) {
                                successMsg("操作成功");
                            }
                        });
                } else {
                    errorMsg("表单内容填写错误，请检查！")
                }
            });
        }

        //文件上传地址
        uploadUrl = API.adminUploadUrl;
    }


</script>

<style scoped>

</style>
